package cnic.ai.nacos.ssh

enum class SSHKeyType(val keyType: Int) {
    KEYTYPE_PASSSWORD(1),
    KEYTYPE_KEYFILES(2),
    KEYTYPE_PUBKEY(3);

    companion object {
        /**
         * 根据keyType返回 SSHKeyType
         * @param keyType
         * @return
         */
        fun KeyType(keyType: Int): SSHKeyType {
            return when (keyType) {
                1 -> KEYTYPE_PASSSWORD
                2 -> KEYTYPE_KEYFILES
                3 -> KEYTYPE_PUBKEY
                else -> KEYTYPE_PASSSWORD
            }
        }
    }
}